package mysqlconn;

import com.alibaba.fastjson.JSON;
import org.I0Itec.zkclient.exception.ZkMarshallingError;
import org.I0Itec.zkclient.serialize.ZkSerializer;

public class MysqlConfigSerializer implements ZkSerializer {
    public byte[] serialize(Object o) throws ZkMarshallingError {
        return JSON.toJSONString(o).getBytes();
    }

    public Object deserialize(byte[] bytes) throws ZkMarshallingError {
        return JSON.parse(new String(bytes));
    }
}
